﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using LGE;

namespace GGJ2014
{
    public static class MapManager
    {
        public const String CollisionLayer = "collision";
        public const String DeathLayer = "death";
        public const String EnemyCollision = "enemycollision";

        // Collision com TILED
        public static float CollisionV(EngineObject obj, Map map, String tileLayerName, bool isUp)
        {
            return isUp ? map.CollisionUp(obj, tileLayerName) : map.CollisionDown(obj, tileLayerName);
        }
        public static float CollisionH(EngineObject obj, Map map, String tileLayerName, bool isLeft)
        {
            return isLeft ? map.CollisionLeft(obj, tileLayerName) : map.CollisionRight(obj, tileLayerName);
        }

        // Desenha todo o mapa
        public static void Draw(SpriteBatch spriteBatch, Map map, Vector2 position)
        {
            map.DrawLayer(spriteBatch, -position, "Camada de Tiles 1");
            //map.DrawLayer(spriteBatch, -position, "doors");
            map.DrawLayer(spriteBatch, -position, "Camada de Tiles 2");
        }

        public static void DrawFG(SpriteBatch spriteBatch, Map map, Vector2 position)
        {
            map.DrawLayer(spriteBatch, -position, "walls1");
            if (GGJ2014.isDebugMode) map.DrawLayer(spriteBatch, -position, "collision");
        }
    }
}
